//		Undead Past: What Drives Support for the Secessionist Goal of the Indigenous //							People of Biafra (IPOB) in Nigeria?

///									Daniel Tuki

* This file presents the codes used to sort the data obtained from the Armed Conflict Loation and Events Database (ACLED)

*To access the ACLED data visit: https://acleddata.com/	

// 			BIAFRA-RELATED INCIDENTS

*Figures 2 and 3 in the manuscript are based on data from ACLED. 

*To keep only observations for Nigeria: 
keep if country == "Nigeria"


*To identify observations containing the words "Biafra" in the variables: Actor 1, actor2, Associated actor 1, and associated actor 2": 

gen biafra_1 = strmatch(actor1, "*Biafra*")
gen biafra_11 = strmatch(assoc_actor_1, "*Biafra*")
gen biafra_2 = strmatch(actor2, "*Biafra")
gen biafra_22 = strmatch(assoc_actor_2, "*Biafra*")

*To generate a variable "secede" where observations greater than 1 implies that the incident involves at least one Biafra-related actor or associated actor:
gen secede = biafra_1 + biafra_11 + biafra_2 + biafra_22

*To drop incidents that do not involve a Biafra-related actor: 
drop if secede == 0

*This leaves only events where at least one of the actors or the associated actor is a Biafra-relaed group. This includes IPOB, MASSOB etc. 



	**TO FILTER OUT INCIDENTS INVOLVING ONLY IPOB**
	
gen ipob_1 = strmatch(actor1, "*Indigenous Peoples of Biafra*")
gen ipob_11 = strmatch(assoc_actor_1, "*Indigenous Peoples of Biafra*")
gen ipob_2 = strmatch(actor2, "*Indigenous Peoples of Biafra")
gen ipob_22 = strmatch(assoc_actor_2, "*Indigenous Peoples of Biafra*")

*To generate the variable "ipob" where values greater than 1 imply that the observation contains the key word "Indigenous Peoples of Biafra":
gen ipob = ipob_1 + ipob_11 + ipob_2 + ipob_22

*To keep only conflicts whereby at least one actor was IPOB: 
keep if ipob > 0

*To compute the associated fatalities with these conflicts, use the "fatalities" variable 
*To compute the annual trend of incidents, use thr "year" variable


						**MEASURING POLITICAL STABILITY***
						
*First reload the full ACLED dataset. 
						
*Political stability: This variable measures the total number of violent conflicts in the Local Government Area (LGA) from 1997 to 2016. I operationalize violent conflicts as incidents that fall under the categories of "Battles" "Violence against civilians" and "Explosions/Remote violence". This covers not only Biafra-related incidents, but all other conflicts like those involving the Boko Haram, nomadic pastoralists, farmers, religious extremists etc. 

tab event_type

*To drop the other categories of conflics that I am not interested in i.e., Riots, Protests, and Strategic Developments:
drop if (event_type == "Riots") 
drop if (event_type == "Protests")
drop if (event_type == "Strategic developments")

*This leaves only incidents classified as "Battles", "Violence against civilians" and "Explosions/Remote violence."

*To keep only the incidents from 1997-2016 that occur prior to the survey:
drop if year > 2016

*I developed this variable for Nigerian's local government areas (admin2 boundaries) using the "count points in polygon" function in QGIS software. The shapefiles containing Nigeria's administrative boundaries could be accessed here: https://data.humdata.org/dataset/nga-administrative-boundaries
